﻿using StoneAge.Contract;
using StoneAge.Controller.Request;
using StoneAge.Controller.Routing;
using StoneAge.DataContract.Messaging;

namespace StoneAge.Controller.Handlers
{
    class GetMapHandler : PostResponseRequestHandler
    {
        private IMapService m_mapService = null;

        public GetMapHandler(IMapService mapService)
            : base(Routes.GET_MAP)
        {
            m_mapService = mapService;
        }

        protected override ResponseBase GetResponseBy(WebRequest webRequest)
        {
            GetMapRequest getMapRequest = new GetMapRequest { RoleId = webRequest.User.RoleId };
            return m_mapService.GetMapBy(getMapRequest);
        }
    }
}
